import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { RchyModule } from './rchy/rchy.module';
import { ConfigModule, ConfigService } from '@nestjs/config';

@Module({
  imports: [
    RchyModule,
    ConfigModule.forRoot({
      cache: true,
      envFilePath:
        process.env.NODE_ENV === 'development'
          ? ['.env.development.local', '.env.development', '.env.local', '.env']
          : ['.env.production.local', '.env.production', '.env.local', '.env'],
    }),
  ],
  controllers: [AppController],
  providers: [AppService, ConfigService],
})
export class AppModule {}
